home *** CD-ROM | disk | FTP | other *** search
- Path: news.drexel.edu!dunx1!st918h5w
- From: st918h5w@dunx1.ocs.drexel.edu (Jonathan Juniman)
- Newsgroups: comp.lang.c++
- Subject: ? about declaration
- Date: 4 Feb 1996 13:40:43 GMT
- Organization: Drexel University
- Message-ID: <4f2d0r$paq@noc2.drexel.edu>
- NNTP-Posting-Host: dunx1.ocs.drexel.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- I am confused about something; I have been trying to declare new variables
- inside of an if statement:
-
- aClass::SomeFunction
- {
- aClass i();
-
- if(SomeCondition == TRUE)
- {
- aClass j();
- }
- }
-
- Some compilers will let me do this, others will not. I was under the
- impression that C++ always lets you do this, so that you don't have
- to allocate stack space for j unless SomeCondition is true. Can
- someone straighten me out about what the standard is, or if there is
- none at all and this sort of thing is compiler dependent? Please reply by
- mail.
- Thanks, -Jon
-